home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / THINKC / 5 / TIME_ZON / CNAMELIS.H < prev    next >
Text File  |  1991-11-08  |  1KB  |  36 lines

  1. /* CNameList.h
  2.  
  3.     This is the header file for an object which is a list of named
  4.         objects (each object has a variable called name, see CNObject). It
  5.         knows how to keep the list ordered, and knows how to edit the
  6.         objects (they actually know how to edit themselves). With CNameList
  7.         CNObjects, and CListBox, the list is almost completely self-
  8.         contained. NOTE: Since the CNameList doesn't really know what kind
  9.         of objects it has, the owner of the CNameList must provide a 
  10.         function which can create and initialize the objects. See the
  11.         CODoc function IODoc() for how this is done.
  12. */
  13.  
  14. #define _H_CNameList
  15.  
  16. #include "CList.h"
  17. #include "CNObject.h"
  18.  
  19. struct CNameList : CList {
  20.     
  21.     CNObject *    (* newFunc)(CObject *);        // The initialization routine
  22.     CObject    *    owner;                        // The object to be passed to the init routine
  23.     
  24.     void        INameList(void);            // Initialization
  25.     void        SetNewFunc(CNObject * (*theFunc)(), CObject *);    // Set the inti function
  26.     
  27.     int            Insert(CNObject *);            // Add a new item to the list
  28.     CNObject    *FindName(char *);            // Find an object by name
  29.     CNObject    *SelectName(void);            // Select an object by dialog
  30.     
  31.     Boolean        Edit(void);
  32. };
  33.  
  34. static Boolean NG(CNObject *,long);            // Name greater
  35. static Boolean NE(CNObject *,long);            // Name equal
  36.